home *** CD-ROM | disk | FTP | other *** search
-
- ;*========================================================================
- ;*
- ;* AESFAST Public Domain GEM bindings.
- ;*
- ;* 09/18/89 v1.3
- ;* This module is new with this release.
- ;*========================================================================
-
- ;*************************************************************************
- ;*
- ;* AESUTRS3.S - Resource-related Utilities 3 of n.
- ;* Non-standard utility functions.
- ;*
- ;*************************************************************************
-
- .include "gemfast.sh"
-
- ;-------------------------------------------------------------------------
- ; rsc_gspec - Get ob_spec value from an object within a tree.
- ; rsc_gpointer - Get pointer to single string within a tree.
- ;
- ; This function gets one string pointer/ob_spec from within
- ; a resource tree. It knows the difference between text and
- ; non-text objects, and gets the ob_spec or te_ptext value
- ; as appropriate. It also understands INDIRECT objects.
- ;
- ; This routine is named both gspec and gpointer so that in
- ; C they can be defined as returning the appropriate type.
- ;
- ; long rsc_gspec(tree, object);
- ; char * rsc_gstrings(tree, object);
- ;-------------------------------------------------------------------------
-
- _rsc_gspec::
- _rsc_gpointer::
-
- .cargs #4,.ptree.l,.object
-
- move.l .ptree(sp),a0
- move.w .object(sp),d2
- muls #OBJ_SIZ,d2
-
- lea ob_spec(a0,d2.l),a1 ; Get ob_spec.
- btst.b #0,ob_flags(a0,d2.l); Is INDIRECT flag set?
- beq.s .notind ; Nope, ob_spec is all set.
- move.l (a1),a1 ; Yep, get real ob_spec.
- .notind:
- move.w ob_type(a0,d2.l),d1 ; Get ob_type.
- cmp.b #G_TEXT,d1
- beq.s .text
- cmp.b #G_BOXTEXT,d1
- beq.s .text
- cmp.b #G_FTEXT,d1
- beq.s .text
- cmp.b #G_FBOXTEXT,d1
- bne.s .string
- .text:
- move.l (a1),a1 ; Get te_ptext
- .string:
- move.l (a1),d0 ; Return ob_spec/te_ptext value.
- rts
-
- ; end of code
-
-